package com.auxgroup.hr.front;

import com.auxgroup.hr.front.commons.utils.Underline2Camel;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by nitongqian on 2019/1/25.
 */
public class EntGen {
    static String[][] ori = {
            {"C_TRANSACTION_NBR","","VARCHAR2"},
            {"C_WF_STATUS","","VARCHAR2"},
            {"C_WF_TYPE","","VARCHAR2"},
            {"C_WF_APP_DT","","DATE"},
            {"TEXT254","","VARCHAR2"},
            {"CREATED_BY","","VARCHAR2"},
            {"CREATEDTTM","","TIMESTAMP"},
            {"LASTUPDOPRID","","VARCHAR2"},
            {"LASTUPDDTTM","","TIMESTAMP"},
            {"C_WF_EMPLID","","VARCHAR2"},
            {"C_WF_EMPL_RCD","","NUMBER"},
            {"C_WF_NAME","","VARCHAR2"},
            {"C_WF_BU","","VARCHAR2"},
            {"C_WF_SETID_DEPT","","VARCHAR2"},
            {"C_WF_DEPTID","","VARCHAR2"},
            {"C_WF_DEPTDESCR","","VARCHAR2"},
            {"C_WF_SETID_JOBCODE","","VARCHAR2"},
            {"C_WF_JOBCODE","","VARCHAR2"},
            {"C_WF_JC_DESCR","","VARCHAR2"},
            {"C_WF_PHONE","","VARCHAR2"},
            {"C_EMPLID2","","VARCHAR2"},
            {"C_WF_JOB_LEVEL","","VARCHAR2"},
            {"C_JOB_TYPE2","","VARCHAR2"},
            {"C_WKLIF_BGN_DT2","","DATE"},
            {"C_WF_COMPANY","","VARCHAR2"},
            {"EMPLID","","VARCHAR2"},
            {"EMPL_RCD","","NUMBER"},
            {"NAME_DISPLAY","","VARCHAR2"},
            {"SEX","","VARCHAR2"},
            {"BIRTHDATE","","DATE"},
            {"MAR_STATUS","","VARCHAR2"},
            {"C_BEAR","","VARCHAR2"},
            {"BUSINESS_UNIT","","VARCHAR2"},
            {"C_BUSN_DESCR","","VARCHAR2"},
            {"SETID_DEPT","","VARCHAR2"},
            {"SETID","","VARCHAR2"},
            {"DEPTID","","VARCHAR2"},
            {"C_ORG_FULLNAME","","VARCHAR2"},
            {"RS_FULL_NAME","","VARCHAR2"},
            {"DEPT_DESCR","","VARCHAR2"},
            {"DESCRSHORT","","VARCHAR2"},
            {"C_DEPT_LEVEL","","VARCHAR2"},
            {"SETID_JOBCODE","","VARCHAR2"},
            {"JOBCODE","","VARCHAR2"},
            {"JOBCODE_DESCR","","VARCHAR2"},
            {"C_JOBCODE","","VARCHAR2"},
            {"JOB_FUNCTION","","VARCHAR2"},
            {"LOCATION","","VARCHAR2"},
            {"C_JOB_LEVEL","","VARCHAR2"},
            {"RS_JOB_LEVEL","","VARCHAR2"},
            {"C_AUX_SYSTEM","","VARCHAR2"},
            {"START_DT_CHN","","DATE"},
            {"C_WKLIF_BGN_DT","","DATE"},
            {"RS_WKLIF_BGN_DT","","DATE"},
            {"LAST_HIRE_DT","","DATE"},
            {"HIGHEST_EDUC_LVL","","VARCHAR2"},
            {"C_SCHOOL","","VARCHAR2"},
            {"C_MAJOR","","VARCHAR2"},
            {"C_EMPL_FROM","","VARCHAR2"},
            {"C_EMPLID","","VARCHAR2"},
            {"C_NAME","","VARCHAR2"},
            {"PHONE","","VARCHAR2"},
            {"C_FINANCIAL_STAFF","","VARCHAR2"},
            {"C_IS_DEPT_MGR","","VARCHAR2"},
            {"C_IS_DXS","","VARCHAR2"},
            {"C_IS_GWHCY","","VARCHAR2"},
            {"C_IS_GROUP_MGR","","VARCHAR2"},
            {"C_IS_SYB_MGR","","VARCHAR2"},
            {"C_IS_CPY_MGR","","VARCHAR2"},
            {"C_JOB_TYPE","","VARCHAR2"},
            {"C_WF_COMPANY2","","VARCHAR2"},
            {"C_CARD_TYPE","","VARCHAR2"},
            {"DATE1","","DATE"},
            {"C_HOUR","","VARCHAR2"},
            {"C_MINUTE2","","VARCHAR2"},
            {"DATE2","","DATE"},
            {"C_HOUR1","","VARCHAR2"},
            {"C_MINUTE3","","VARCHAR2"},
            {"C_YES_NO","","VARCHAR2"},
            {"C_APPL_INFO","","VARCHAR2"},
            {"C_OTHER_EXPLAIN","","CLOB"},

    };

    static Map typeMap = new HashMap();
    static {
        typeMap.put("CHAR", "String");
        typeMap.put("LONG", "String");
        typeMap.put("CHAR", "String");
        typeMap.put("VARCHAR2", "String");
        typeMap.put("SIGNEDNUMBER", "BigDecimal");
        typeMap.put("NUMBER", "BigDecimal");
        typeMap.put("DATE", "Date");
        typeMap.put("TIMESTAMP", "Date");
    }
    public static void main(String args[]) {
//
//        System.out.println(new BigDecimal(222).compareTo(new BigDecimal(10000000)));
//        BigDecimal a = new BigDecimal(222);
//        a.add(new BigDecimal(10000000));
//
//        System.out.println(a.toString());
        for(String[] row : ori) {

            //System.out.println("//" + row[1]);
            if(row[2].equals("LONG")) {
                System.out.println("@Lob");
            }
            if(row[2].equals("DATE")) {
                System.out.println("@Temporal(TemporalType.DATE)");
            }


            System.out.println("@Column(name = \"" + row[0] + "\")");
            System.out.println("private " + typeMap.get(row[2]) + " " +
                Underline2Camel.underline2Camel(row[0], true) + ";");
        }
    }
}
